package main

import (
	"fmt"
	"github.com/garyburd/redigo/redis"
)

func main() {
	redisHost := "10.77.44.158:6379"

	c, err := redis.Dial("tcp",redisHost)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer c.Close()

	v,err := c.Do("SEt","name","cs2")
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(v)

	v,err = redis.String(c.Do("get","name"))
	fmt.Println(v)

	c.Do("lpush", "redlist", "qqq")
	c.Do("lpush", "redlist", "www")
	c.Do("lpush", "redlist", "eee")

	values, _ := redis.Values(c.Do("lrange", "redlist", "0", "100"))
	for _, v := range values {
	    fmt.Print(string(v.([]byte)), ' ')//空格被打印成32 ?
 	}
}
